const path = require('path');
const HtmlPlugin = require('html-webpack-plugin');
const merge = require('webpack-merge');


const cwd = process.cwd();
const appRoot = cwd;
const appDir = path.join(cwd, 'src');
const outDir = path.join(cwd, 'dist');

const config = {
  context: appRoot,
  entry: './src/index.jsx',
  output: {
    path: outDir,
  },
  devtool: 'cheap-module-source-map',
  resolve: {
    extensions: ['.jsx', '.js', '.json', '.ts', '.tsx']
  },
  module: {
    rules: [{ oneOf: [
      {
        test: /\.jsx?/i,
        exclude: /node_modules/,
        loader: 'babel-loader',
      }
    ]}]
  },
  plugins: [
    new HtmlPlugin(),
  ]
}

module.exports = config;